/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scittbescun")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scittbescun.findAll", query = "SELECT s FROM Scittbescun s"),
    @NamedQuery(name = "Scittbescun.findByScittbescunid", query = "SELECT s FROM Scittbescun s WHERE s.scittbescunid = :scittbescunid"),
    @NamedQuery(name = "Scittbescun.findByNombre", query = "SELECT s FROM Scittbescun s WHERE s.nombre = :nombre"),
    @NamedQuery(name = "Scittbescun.findByObservaciones", query = "SELECT s FROM Scittbescun s WHERE s.observaciones = :observaciones")})
public class Scittbescun implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scittbescunid")
    private Integer scittbescunid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scittbescunid")
    private Collection<Pyivtbtrasutiles> pyivtbtrasutilesCollection;
    @OneToMany(mappedBy = "scittbescunid")
    private Collection<Scsgtbusurol> scsgtbusurolCollection;
    @JoinColumn(name = "scittbfadeceid", referencedColumnName = "scittbfadeceid")
    @ManyToOne(optional = false)
    private Scittbfadece scittbfadeceid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scittbescunid")
    private Collection<Pyivtbtrasinv> pyivtbtrasinvCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scittbescunid")
    private Collection<Pyivtbinventa> pyivtbinventaCollection;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "scittbescun")
    private Scaltblinescu scaltblinescu;
    @OneToMany(mappedBy = "scittbescunid")
    private Collection<Pyfntbpedestad> pyfntbpedestadCollection;
    @OneToMany(mappedBy = "scittbescunid")
    private Collection<Pyfntbpedvicom> pyfntbpedvicomCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scittbescunid")
    private Collection<Pyivtbmob> pyivtbmobCollection;
    @OneToMany(mappedBy = "scittbescunid")
    private Collection<Pyfntbpersvico> pyfntbpersvicoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scittbescunid")
    private Collection<Pyivtbtrasmob> pyivtbtrasmobCollection;
    @OneToMany(mappedBy = "scittbescunid")
    private Collection<Sctstbtesis> sctstbtesisCollection;

    public Scittbescun() {
    }

    public Scittbescun(Integer scittbescunid) {
        this.scittbescunid = scittbescunid;
    }

    public Scittbescun(Integer scittbescunid, String nombre, String observaciones) {
        this.scittbescunid = scittbescunid;
        this.nombre = nombre;
        this.observaciones = observaciones;
    }

    public Integer getScittbescunid() {
        return scittbescunid;
    }

    public void setScittbescunid(Integer scittbescunid) {
        this.scittbescunid = scittbescunid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Pyivtbtrasutiles> getPyivtbtrasutilesCollection() {
        return pyivtbtrasutilesCollection;
    }

    public void setPyivtbtrasutilesCollection(Collection<Pyivtbtrasutiles> pyivtbtrasutilesCollection) {
        this.pyivtbtrasutilesCollection = pyivtbtrasutilesCollection;
    }

    @XmlTransient
    public Collection<Scsgtbusurol> getScsgtbusurolCollection() {
        return scsgtbusurolCollection;
    }

    public void setScsgtbusurolCollection(Collection<Scsgtbusurol> scsgtbusurolCollection) {
        this.scsgtbusurolCollection = scsgtbusurolCollection;
    }

    public Scittbfadece getScittbfadeceid() {
        return scittbfadeceid;
    }

    public void setScittbfadeceid(Scittbfadece scittbfadeceid) {
        this.scittbfadeceid = scittbfadeceid;
    }

    @XmlTransient
    public Collection<Pyivtbtrasinv> getPyivtbtrasinvCollection() {
        return pyivtbtrasinvCollection;
    }

    public void setPyivtbtrasinvCollection(Collection<Pyivtbtrasinv> pyivtbtrasinvCollection) {
        this.pyivtbtrasinvCollection = pyivtbtrasinvCollection;
    }

    @XmlTransient
    public Collection<Pyivtbinventa> getPyivtbinventaCollection() {
        return pyivtbinventaCollection;
    }

    public void setPyivtbinventaCollection(Collection<Pyivtbinventa> pyivtbinventaCollection) {
        this.pyivtbinventaCollection = pyivtbinventaCollection;
    }

    public Scaltblinescu getScaltblinescu() {
        return scaltblinescu;
    }

    public void setScaltblinescu(Scaltblinescu scaltblinescu) {
        this.scaltblinescu = scaltblinescu;
    }

    @XmlTransient
    public Collection<Pyfntbpedestad> getPyfntbpedestadCollection() {
        return pyfntbpedestadCollection;
    }

    public void setPyfntbpedestadCollection(Collection<Pyfntbpedestad> pyfntbpedestadCollection) {
        this.pyfntbpedestadCollection = pyfntbpedestadCollection;
    }

    @XmlTransient
    public Collection<Pyfntbpedvicom> getPyfntbpedvicomCollection() {
        return pyfntbpedvicomCollection;
    }

    public void setPyfntbpedvicomCollection(Collection<Pyfntbpedvicom> pyfntbpedvicomCollection) {
        this.pyfntbpedvicomCollection = pyfntbpedvicomCollection;
    }

    @XmlTransient
    public Collection<Pyivtbmob> getPyivtbmobCollection() {
        return pyivtbmobCollection;
    }

    public void setPyivtbmobCollection(Collection<Pyivtbmob> pyivtbmobCollection) {
        this.pyivtbmobCollection = pyivtbmobCollection;
    }

    @XmlTransient
    public Collection<Pyfntbpersvico> getPyfntbpersvicoCollection() {
        return pyfntbpersvicoCollection;
    }

    public void setPyfntbpersvicoCollection(Collection<Pyfntbpersvico> pyfntbpersvicoCollection) {
        this.pyfntbpersvicoCollection = pyfntbpersvicoCollection;
    }

    @XmlTransient
    public Collection<Pyivtbtrasmob> getPyivtbtrasmobCollection() {
        return pyivtbtrasmobCollection;
    }

    public void setPyivtbtrasmobCollection(Collection<Pyivtbtrasmob> pyivtbtrasmobCollection) {
        this.pyivtbtrasmobCollection = pyivtbtrasmobCollection;
    }

    @XmlTransient
    public Collection<Sctstbtesis> getSctstbtesisCollection() {
        return sctstbtesisCollection;
    }

    public void setSctstbtesisCollection(Collection<Sctstbtesis> sctstbtesisCollection) {
        this.sctstbtesisCollection = sctstbtesisCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scittbescunid != null ? scittbescunid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scittbescun)) {
            return false;
        }
        Scittbescun other = (Scittbescun) object;
        if ((this.scittbescunid == null && other.scittbescunid != null) || (this.scittbescunid != null && !this.scittbescunid.equals(other.scittbescunid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scittbescun[ scittbescunid=" + scittbescunid + " ]";
    }
    
}
